﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace LogManager.Config
{
    [ConfigurationCollection(typeof(LogTypeConfiguration), AddItemName = "logType")]
    public class LogTypeCollection : ConfigurationElementCollection
    {
        public new LogTypeConfiguration this[string typeId]
        {
            get { return (LogTypeConfiguration)BaseGet(typeId); }
        }

        public LogTypeConfiguration this[int index]
        {
            get { return (LogTypeConfiguration)BaseGet(index); }
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((LogTypeConfiguration)element).TypeId;
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new LogTypeConfiguration();
        }

        public void Add(LogTypeConfiguration archive)
        {
            BaseAdd(archive);
        }

        public void Remove(LogTypeConfiguration archive)
        {
            BaseRemove(archive);
        }
    }
}
